#include <iostream>

template<typename> class A;

template<typename T> bool operator==(const A<T>&, const A<T>&);

template<typename T> class A
{
public:
	T n;
	A(const T& x): n(x){}

	friend bool operator==<T>(const A<T>& a, const A<T>& b);
};

template<> bool operator==<int>(const A<int>& a, const A<int>& b)
{
	return a.n == b.n;
}

template<> bool operator==<std::string>(const A<std::string>& a, const A<std::string>& b)
{
	return a.n == b.n;
}

int main()
{
	A<int> a(1), b(2);
	A<std::string> c("this"), d("this");
	std::cout << std::boolalpha << (a == b) << std::endl;
	std::cout << (c == d) << std::endl;
}